package com.rain.rainspringboot3.encryption.factory;


import com.rain.rainspringboot3.encryption.strategy.AESEncryptionStrategy;
import com.rain.rainspringboot3.encryption.strategy.EncryptionStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * AES加密工厂
 * 创建AES加密策略实例
 */
@Component
public class AESEncryptFactory implements EncryptFactory {
    
    @Autowired
    private AESEncryptionStrategy aesEncryptionStrategy;
    
    @Override
    public EncryptionStrategy createStrategy() {
        return aesEncryptionStrategy;
    }
    
    @Override
    public String getAlgorithmName() {
        return "AES";
    }
}